package bean.entity;

import java.util.Date;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.datanucleus.annotations.Unowned;

@PersistenceCapable
public class Discussion {
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	@Unowned
	private List<DiscussContent> discussContents;
	
	@Persistent
	private Date latestTime;

	public Discussion(Key key, List<DiscussContent> discussContents,
			Date latestTime) {
		super();
		this.key = key;
		this.discussContents = discussContents;
		this.latestTime = latestTime;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}

	public List<DiscussContent> getDiscussContents() {
		return discussContents;
	}

	public void setDiscussContents(List<DiscussContent> discussContents) {
		this.discussContents = discussContents;
	}

	public Date getLatestTime() {
		return latestTime;
	}

	public void setLatestTime(Date latestTime) {
		this.latestTime = latestTime;
	}
}
